/****
    * HexGlass is a Tetris-like puzzle game.
    *
    * Project homepage: http://hexglass.googlecode.com/
    *
    * Copyright (C) 2010 Alexey Michurin <a.michurin@gmail.com>
    *
    * This program is free software: you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation, either version 3 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****/

#include "figure.h"

Figure::Figure() :
    figure_color(0)
{
}

Figure::Figure(
    int x1, int y1,
    int x2, int y2,
    int x3, int y3,
    int x4, int y4,
    int xo, int yo,
    int clr) :
    figure_color(clr)
{
    figure[0].x = x1;
    figure[1].x = x2;
    figure[2].x = x3;
    figure[3].x = x4;
    figure[4].x = xo;
    figure[0].y = y1;
    figure[1].y = y2;
    figure[2].y = y3;
    figure[3].y = y4;
    figure[4].y = yo;
}

int
Figure::color() const {
    return figure_color;
}

void
Figure::shift(LPlace const & logical_shift) {
    PPlace shift(logical_shift);
    for (int i(0); i<5; ++i) {
        figure[i] += shift;
    }
}
